enum IpAddrkind {
    V4,
    V6,
}
#[derive(Debug)]
enum Item<T> {
    Some(T),
    None,
}
fn main() {
    struct IpAddr {
        kind: IpAddrkind,
        address: String,
    }
    let four = IpAddrkind::V4;
    let six = IpAddrkind::V6;
    let some_number = Some(5);
    let some_string = Some("a string");
    println!("asdf{:?}", some_number);
    println!("some_string{:?}", some_string);
    route(IpAddrkind::V4);
    route(IpAddrkind::V6);
    let home = IpAddr {
        kind: IpAddrkind::V4,
        address: String::from("127.0.0.1"),
    };
    let loopback = IpAddr {
        kind: IpAddrkind::V6,
        address: String::from("::1"),
    };
    ip_fn();
    impl_test();
    // let absent_number: Option<i32> = Option::Some(11);
    // println!("{:?}", absent_number)
}
fn route(ip_type: IpAddrkind) {}
fn ip_fn() {
    #[derive(Debug)]
    enum IpAddr {
        V4(String),
        V6(String),
    }
    let home = IpAddr::V4(String::from("127.0.0.1"));
    let loopback = IpAddr::V6(String::from("::1"));
    println!("home,{:?}", home)
}
#[derive(Debug)]
enum Message {
    Quit,
    Move { x: i32, y: i32 },
    Write(String),
    ChangeColor(i32, i32, i32),
}
impl Message {
    fn call(&self) {
        println!("hello")
    }
}
fn impl_test() {
    let msg = Message::Write(String::from("wukong"));
    println!("msg{:?}", msg);
    msg.call()
}
